import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/book',
    name: 'Book',
    component: () => import(/* webpackChunkName: "book" */ '@/views/Book/Index.vue'),
    // redirect: "/book/classify",
    children: [
      {
        path: 'home',
        component: () => import(/* webpackChunkName: "book" */ '@/views/Book/Pages/HomeIndex.vue'),
      },
      {
        path: 'classify',
        component: () => import(/* webpackChunkName: "book" */ '@/views/Book/Pages/Classify.vue'),
      },
      {
        path: 'rack',
        component: () => import(/* webpackChunkName: "book" */ '@/views/Book/Pages/BookRack.vue'),
      },
      {
        path: 'top',
        component: () => import(/* webpackChunkName: "book" */ '@/views/Book/Pages/Top.vue'),
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
